#!/usr/bin/env python
# -*- coding:utf-8 -*-

from django.forms.widgets import TextInput, RadioSelect, CheckboxSelectMultiple


class DatePickerInput(TextInput):
    template_name = 'stark/form/date_picker_input.html'


class StarkRadioSelect(RadioSelect):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        if self.attrs.get('class'):
            self.attrs['class'] += 'stark-radio'
        else:
            self.attrs['class'] = 'stark-radio'


class StarkCheckboxSelectMultiple(CheckboxSelectMultiple):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        if self.attrs.get('class'):
            self.attrs['class'] += 'stark-multi-checkbox'
        else:
            self.attrs['class'] = 'stark-multi-checkbox'
